package com.ssyu.examination.system.service;

import java.util.ArrayList;
import java.util.List;

import org.apache.commons.lang3.StringUtils;

import com.ssyu.examination.conmmon.PageModel;
import com.ssyu.examination.conmmon.util.DBUtil;
import com.ssyu.examination.system.entity.RoleEntity;

public class RoleService {

	public static PageModel<RoleEntity> listRole(int page, int rows, String role) {
		List<Object> objects = new ArrayList<Object>();

		StringBuilder sb = new StringBuilder();
		sb.append("SELECT id,name,operate_time,state FROM sys_role ");
		sb.append("WHERE state = 1");
		sb.append(" ORDER BY id DESC LIMIT ?,?");
		objects.add((page - 1) * rows);
		objects.add(rows);
		return DBUtil.executeQueryByPage(RoleEntity.class, sb.toString(),
				objects);
	}


}
